package cn.com.code.design.engine.impl;

import cn.com.code.design.EngineBase;
import cn.com.code.design.model.aggregates.TreeRich;
import cn.com.code.design.model.vo.EngineResult;
import cn.com.code.design.model.vo.TreeNode;

import java.util.Map;

/**
 * 决策引擎的实现
 * @author zhengpei
 * @date 2021/9/27
 */
public class TreeEngineHandle extends EngineBase {

  @Override
  public EngineResult process(Long treeId, String userId, TreeRich treeRich, Map<String, String> decisionMatter) {
    // 决策流程
    TreeNode treeNode = engineDecisionMaker(treeRich, treeId, userId, decisionMatter);
    // 决策结果
    return new EngineResult(userId, treeId, treeNode.getTreeNodeId(), treeNode.getNodeValue());
  }

}
